#include<stdio.h>

int covert(int x){
    int m;
    m=x%8;
    x=x/8;
    if(x!=0){
        covert(x);
        printf("%d",m);
    }
    else
      printf("%d",m);
}
int main()
{
    int a;
    scanf("%d",&a);
    int ret=covert(a);
}